package com.spy.material.domain;

import java.math.BigDecimal;
import java.time.LocalDateTime;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.spy.common.annotation.Excel;
import com.spy.common.core.domain.BaseEntity;

import javax.validation.constraints.NotBlank;

/**
 * 采购明细对象 purchase_order_detail
 *
 * @author twc
 * @date 2025-11-09
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("采购明细实体")
public class PurchaseOrderDetail extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @ApiModelProperty("主键ID")
    private Long id;

    /**
     * 物料名称
     */
    @Excel(name = "物料名称")
    @ApiModelProperty("物料名称")
    private String materialName;

    /**
     * 物料类别
     */
    @Excel(name = "物料类别")
    @ApiModelProperty("物料类别")
    private String materialCategory;

    /**
     * 单位
     */
    @Excel(name = "单位")
    @ApiModelProperty("单位")
    private String unit;

    /**
     * 单价
     */
    @Excel(name = "单价")
    @ApiModelProperty("单价")
    private BigDecimal unitPrice;

    /**
     * 采购数量
     */
    @Excel(name = "采购数量")
    @ApiModelProperty("采购数量")
    private Integer purchaseQuantity;

    /**
     * 实际收货数量
     */
    @Excel(name = "实际收货数量")
    @ApiModelProperty("实际收货数量")
    private Integer actualReceivedQuantity;

    /**
     * 采购总金额
     */
    @Excel(name = "采购总金额")
    @ApiModelProperty("采购总金额")
    private BigDecimal purchaseTotalPrice;

    /**
     * 实际收货总金额
     */
    @Excel(name = "实际收货总金额")
    @ApiModelProperty("实际收货总金额")
    private BigDecimal actualReceivedTotalPrice;

    /**
     * 采购单ID（外键）
     */
    @Excel(name = "采购单ID", readConverterExp = "外=键")
    @ApiModelProperty("采购单ID（外键）")
    private Long purchaseOrderId;

    /**
     * 采购日期
     */
    @NotBlank(message = "采购日期不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "入库日期（格式：YYYY-MM-DD HH:mm:ss）", example = "2025-11-14 8:30:00")
    private LocalDateTime purchaseDate;

}